﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _24点
{
    class Program
    {
        static void Main(string[] args)
        {
            DateTime start = DateTime.Now;
            Console.WriteLine("求解开始");
            Console.WriteLine();

            int[] number = new int[] { 8, 8, 3, 3 };
            Console.WriteLine($"求解{number[0]},{number[1]},{number[2]},{number[3]}");
            Solution solution = new(number);
            HashSet<string> set = new();

            List<int[]> numbersList = solution.NumberList();
            foreach(var numbers in numbersList)
            {
                solution.Fun1(numbers, set);
                solution.Fun2(numbers, set);
                solution.Fun3(numbers, set);
                solution.Fun4(numbers, set);
                solution.Fun5(numbers, set);
            }

            foreach(var str in set)
            {
                Console.WriteLine(str);
            }

            if (!set.Any())
            {
                Console.WriteLine("无解");
            }

            Console.WriteLine();
            DateTime end = DateTime.Now;
            Console.WriteLine("求解结束");
            Console.WriteLine($"耗时:{(end - start).TotalMilliseconds}毫秒");
        }
    }
}
